<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>欢迎</title>
    <link href="favicon.ico" rel="icon" type="image/x-icon"/>
    <!--弹窗 css文件-->
    <link rel="stylesheet" type="text/css" th:href="@{../../static/js/layer/layer.css}">
    <!--layui框架CSS-->
    <link rel="stylesheet" th:href="@{../../static/js/layui/css/layui.css}" media="all"/>
    <!--主要css样式-->
    <link rel="stylesheet" th:href="@{../../static/css/models.css}">
</head>
<body>
    <h1>hello 你好</h1>
    <form id="formID" action="/add" method="post">
        <p class="loginTxt">用户名：<input class="validate[required]" name="userName" type="text"
                                   placeholder="请输入登录账号"></p>
        <p class="loginTxt">密码：<input class="validate[required]" name="passWord" type="passWord" placeholder="请输入登录密码">
        </p>
        <p class="loginBtn"><input name="loginBtn" id="loginBtn" type="submit" value="登录"></p>
    </form>
</body>
<script type="text/javascript" th:src="@{../../static/js/layer/layer.js}"></script>
<!-- 验证 -->
<script type="text/javascript" th:src="@{../../static/js/validat/jquery.validationEngine.js}"></script>
<script type="text/javascript" th:src="@{../../static/js/validat/jquery.validationEngine-zh_CN.js}"></script>
<script type="text/javascript">
    $(function () {
        $("#formID").validationEngine({
            addPromptClass: 'formError-text',
            showArrow: false,
            promptPosition: 'bottomLeft:10 0'
        });

        // 回车事件
        document.onkeydown = function (e) {
            var ev = document.all ? window.event : e;
            if (ev.keyCode == 13) {

                $("#formID").submit();
            }
        };

        if (window != top) {
            top.location.href = location.href;
        }


        $("#loginBtn").click(function () {
            alert("jjjjjj");
            $("#formID").submit();
        });
    });
</html>